package com.sourcetrip.linkedlist;


import com.sourcetrip.raw.adt.MySingleLinkedList;

/**
 * @author: ZhouBert
 * @date: 2020/11/17
 * @description:	MySingleLinkedList 自实现单链表测试
 */
public class MySingleLinkedListTest01 {

	public static void main(String[] args) {
		// Integer 的测试
		MySingleLinkedList<Integer> intSingleLinkedList = new MySingleLinkedList<Integer>();
		intSingleLinkedList.add(1);
		intSingleLinkedList.add(2);
		intSingleLinkedList.add(3);
		intSingleLinkedList.add(4);
		intSingleLinkedList.add(5);

		//toString
		System.out.println("intSingleLinkedList = " + intSingleLinkedList+";size:"+intSingleLinkedList.size());

		//add(int)
		intSingleLinkedList.add(1,10);
		System.out.println("intSingleLinkedList = " + intSingleLinkedList+";size:"+intSingleLinkedList.size());

		//remove
		intSingleLinkedList.remove(0);
		System.out.println("intSingleLinkedList = " + intSingleLinkedList+";size:"+intSingleLinkedList.size());

		//indexOf
		System.out.println("index:"+intSingleLinkedList.indexOf(2));

		//contains
		System.out.println("contains:"+intSingleLinkedList.contains(10));

		//clear
		intSingleLinkedList.clear();
		System.out.println("intSingleLinkedList = " + intSingleLinkedList+";size:"+intSingleLinkedList.size());

		intSingleLinkedList.get(0);
	}
}
